import axios from "axios";
const api = axios.create({
    baseURL: "http://localhost:3000"
})

export default {
    state() {
        return {
            apiData: {},
        }
    },
    getters: {
        apiData(state) {
            return state.apiData;
        }
    },
    mutations: {
        setApiData(state, value) {
            state.apiData = value;
        }
    },
    actions: {
        getApiData({ commit }) {
            return api.get("/create").then(res => {
                commit("setApiData", res.data);
            })
        }
    }
}